using System;
using System.Configuration;
using System.Web;
using System.Collections;
using System.Collections.Generic;
using System.Web.Services;
using System.Web.Services.Protocols;

using Com.Grubbland.Data.Objects;
using Com.Grubbland.Data.Access;


/// <summary>
/// Summary description for MediaService
/// </summary>
[WebService(Namespace = "http://eelms.grubbland.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class MediaService : System.Web.Services.WebService {

    private string cs = ConfigurationManager.ConnectionStrings["etConnStr"].ConnectionString;
    private MediaServiceImpl svc;

    public MediaService () {

        svc = new MediaServiceImpl(cs);
    }

    [WebMethod]
    public string HelloWorld() {
        return "Hello World";
    }

    [WebMethod]
    public string VarLoader( Activity a, Media m, String s, int i )
    {
        return "Hello World";
    }


    [WebMethod]
    public Media GetMediaItem(string mediaId)
    {
        return svc.GetMediaItem(mediaId);
    }

    [WebMethod]
    public Media GetMediaItemByCatalogId(string catalogId)
    {
        return svc.GetMediaItemByCatalogId(catalogId);
    }

    [WebMethod]
    public List<Media> SearchMediaItems(Media m)
    {
        return svc.SearchMediaItems(m);
    }

    [WebMethod]
    public List<Media> GetMediaList(int pageSize, string lastIndex)
    {
        return svc.GetMediaList(pageSize,lastIndex);
    }

    [WebMethod]
    public string InsertMediaItem(Media media)
    {
        return svc.InsertMediaItem(media);
    }

    [WebMethod]
    public bool UpdateMediaItem(Media media)
    {
        return svc.UpdateMediaItem(media);
    }

    
}

